%%%----------------------------------------------------------
\chapter{Detecting the outlines of a marker in an image}
%%%----------------------------------------------------------
\label{cha:marker}
\section{Problem}
An arbitrary image (see figure ~\ref{fig:03_twomarker}) contains one or more quadrilateral structures (preferably in the form of AR markers) with thick distinct borders. A robust and reliable algorithm should be devised to find and mark the corners of these structures regardless of viewing angle and size.

\begin{figure}
	\centering
	\includegraphics[width=.75\textwidth]{03_marker-test-01small}
	\caption{Image of the best found lines.}
	\label{fig:03_twomarker}
\end{figure}

\section{Solution}
The incremental line fitting algorithm traverses all edge points of the structures. These points are used for conventional line fitting to get an algebraic line. Every new point that will be included will be checked if the distance is close enough. If not a new line is started. This procedure is repeated until all points for the contour is traversed. The corner points of the structures are calculated by intersecting all adjacent lines.

\section{Implementation}



\begin{figure}
	\centering
	\includegraphics[width=.75\textwidth]{03_marker}
	\caption{Image of a marker.}
	\label{fig:03_marker}
\end{figure}

\begin{figure}
	\centering
	\includegraphics[width=.75\textwidth]{03_marker_algebraic}
	\caption{Image with algebraic lines.}
	\label{fig:03_marker_albebraic}
\end{figure}

\section{Result}

\begin{figure}
	\centering
	\includegraphics[width=.75\textwidth]{03_marker_final}
	\caption{Image with the contour of the marker.}
	\label{fig:03_markerfinal}
\end{figure}
